package com.example.tests;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import java.util.Random;

import org.testng.annotations.Test;

import com.example.utils.SortedListOf;

public class TestFolderDeletion extends TestBase {
	
	@Test
	public void FolderDeletion(){
		
		app.getFolderHelper().createFolders(5);
		
		SortedListOf<String> oldFolders = app.getFolderHelper().getFolders();
		
		Random rnd = new Random();
		int index = rnd.nextInt(oldFolders.size());
		app.getFolderHelper().deleteFolder(index);
		
		SortedListOf<String> newFolders = app.getFolderHelper().getFolders();
		assertThat(newFolders, equalTo(oldFolders.without(index)));
	}
}
